import './Mars3dSetUp.scss'
import { Button } from 'antd'
import PropTypes from 'prop-types'

import { optionsList } from '../../Assets/Params'
import { UseConfigSection } from '../../Template/FormTemplate'

const Mars3dFitA02 = ({ data, Off, ModalEvent }) => {
    Mars3dFitA02.propTypes = { data: PropTypes.object, Off: PropTypes.func, ModalEvent: PropTypes.object }

    const list = [
        { key: 101, uuid: 'FitA02', label: '显示地球', type: 'RadioTemp', name: 'show', options: optionsList.isShow },
        { key: 102, uuid: 'FitA02', label: '昼夜区域', type: 'RadioTemp', name: 'enableLighting', options: optionsList.isEnable },
        { key: 103, uuid: 'FitA02', label: '地面大气', type: 'RadioTemp', name: 'showGroundAtmosphere', options: optionsList.isEnable },
        { key: 104, uuid: 'FitA02', label: '深度监测', type: 'RadioTemp', name: 'depthTestAgainstTerrain', options: optionsList.isEnable },
        { key: 105, uuid: 'FitA02', label: '地形夸张', type: 'SliderTemp', name: 'terrainExaggeration', options: { min: 0, max: 80 } },
    ]

    const onSubmit = () => {
        ModalEvent.emit({ type: 'scene', data })
        Off()
    }

    return (
        <div className='Mars3dSetUp Mars3dFitA02'>
            <div className='FormList'>
                {UseConfigSection(data, list)}
            </div>
            <div className='Button'>
                <Button type='primary' danger onClick={Off}>取消</Button>
                <Button type='primary' onClick={onSubmit}>保存</Button>
            </div>
        </div>
    );
};

export default Mars3dFitA02;